﻿using Microsoft.Xna.Framework;
using Main.lib.graphics;
using Main.lib.input;

using Microsoft.Xna.Framework.Input;

namespace Main.lib.scene
{

    public sealed class Scene_Title : Scene_Base
    {

        public Text title, subtitle;

        public override void Start()
        {
            title = new Text("Pong");
            title.Position.X = Graphics.Width / 2;
            title.Position.Y = Graphics.Height / 2;
            title.Origin.X = title.Size().X / 2;
            title.Origin.Y = title.Size().Y / 2;

            subtitle = new Text("1 - 1P\n2 - 2P");
            subtitle.Position.X = (Graphics.Width - subtitle.Size().X) / 2;
            subtitle.Position.Y = (Graphics.Height - subtitle.Size().Y) / 1.2f;
        }

        public override void Update()
        {
            title.Rotation += 0.025f;
            if (Input.Press(Keys.D1))
                Scene.Set(new Scene_Play(0));
            if (Input.Press(Keys.D2))
                Scene.Set(new Scene_Play(1));
        }

        public override void Terminate()
        {
            title.Dispose();
            subtitle.Dispose();
        }

    }

}